package com;

import com.pojo.Customer;
import com.pojo.Student;
import com.utils.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.List;

public class StudentTest {
@Test
public void  findStudntByNameOrMajorTest(){
    SqlSession session = MyBatisUtils.getSession();
    Student student = new Student();
    student.setSname("tom");
    student.setMajor("计应");
    List<Student> students = session.
            selectList("com.mapper.StudentMapper.findStudentByNameOrMajor",student);
    for (Student s:students){
        System.out.println(s);
    }
    session.close();
}
@Test
    public void  findByArrayTest(){
        SqlSession session = MyBatisUtils.getSession();
        Integer[] roleIds = {1,2,3,4};
        List<Student> students = session.selectList
                ("com.mapper.StudentMapper.findByArray",roleIds);
        for (Student student:students){
            System.out.println(student);
        }
        session.close();
    }
}